<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<input type="text" class="ipt1">
<select name="" class="ac">
    <option value="+">+</option>
    <option value="-">-</option>
    <option value="*">*</option>
    <option value="/">/</option>
</select>
<input type="text" class="ipt2">
<button class="but">=</button>
<input type="text" class="ipt3">

<body>
    <script>
        var Ipt1 = document.getElementsByClassName("ipt1")[0];
        var Ipt2 = document.getElementsByClassName("ipt2")[0];
        var Ipt3 = document.getElementsByClassName("ipt3")[0];
        var But = document.getElementsByClassName("but")[0];
        var Ace = document.getElementsByClassName("ac")[0];
        But.onclick = function () {
            var ipt1 = parseInt(Ipt1.value);
            var ipt2 = parseInt(Ipt2.value);
            var ac = Ace.value;
            var but = But.value;
            if (ac == "+") {
                ipt3 = ipt1 + ipt2
            }
            else if (ac == "-") {
                ipt3 = ipt1 - ipt2
            }
            else if (ac == "*") {
                ipt3 = ipt1 * ipt2
            }
            else if (ac == "/") {
                ipt3 = ipt1 / ipt2
            }
            console.log(ipt3);
            Ipt3.value = ipt3;
        }
        // var Ipt1 = document.getElementsByClassName("ipt1")[0];
        // var Ipt2 = document.getElementsByClassName("ipt2")[0];
        // var Ipt3 = document.getElementsByClassName("ipt3")[0];
        // var But = document.getElementsByClassName("but")[0];
        // But.onclick = function () {
        //     var ipt1 = Ipt1.value - 0
        //     var ipt2 = Ipt2.value - 0
        //     if (!isNaN(ipt1, ipt2)) {
        //         if (ac.value == "+") {
        //             Ipt3.value = ipt1 + ipt2
        //         }
        //     }
        // }
    </script>


</body>

</html>